import { test } from "node:test"; import assert from "node:assert/strict"; import { sum } from "../index.js"; test("sum with positive numbers", () => { assert.strictEqual(sum(1, 2, 3), 6); }); test("sum with negative and positive numbers", () => { assert.strictEqual(sum(-1, 1, -2, 2), 0); }); test("sum of empty array", () => { assert.strictEqual(sum(), 0); }); test("sum of large dataset", () => { const largeDataset = Array.from({ length: 1000 }, (_, i) => i + 1); assert.strictEqual(sum(...largeDataset), (1000 * 1001) / 2); });